home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 22
/
Cream of the Crop 22.iso
/
program
/
eflibpt4.zip
/
DEMO
/
TESTING
/
STRUCT1.PAS
< prev
Wrap
Pascal/Delphi Source File
|
1996-08-16
|
1KB
|
41 lines
{ Borland Pascal Extended Function Library - EFLIB (C) Johan Larsson, 1996
Testing; miscellaneous handling of doubly linked data structures
EFLIB IS PROTECTED BY THE COPYRIGHT LAW AND MAY NOT BE COPIED, SOLD OR
MANIPULATED. FOR MORE INFORMATION, SEE PROGRAM MANUAL! THIS DEMONSTRAT-
ION PROGRAM MAY FREELY BE USED AND DISTRIBUTED. }
uses EFLIBDEF, EFLIBDAT, EFLIBTXT, EFLIBOBJ;
var Structure : StructureObjectType;
Node : LinkageObjectPointerType;
Data : string[40];
Index : word;
Memory : longint;
begin
Memory := MemAvail;
with Structure do begin
Initialize (SizeOf(Data));
Randomize;
{ Generate a structure containing randomly generated data }
for Index := 1 to 2000 do begin
Data := StringGeneratedRandomly (Pred(SizeOf(Data)));
Add (Data);
end;
WalkUsing (Node, IndexedNode(1), 1998);
if (Elements <> 2000) or (Node <> LastNode^.Predecessor) or not IsIntact then
WriteLn ('Error in structure!');
Intercept;
end;
if Memory <> MemAvail then WriteLn ('Error in structure disposal.');
WriteLn ('Testing completed.');
end.